home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ATA.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  53.6 KB  |  1,059 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ATA.p
  3.  
  4.      Contains:    ATA (PC/AT Attachment) Interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ATA;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __ATA__}
  27. {$SETC __ATA__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ATAIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __MIXEDMODE__}
  37. {$I MixedMode.p}
  38. {$ENDC}
  39.  
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45.  
  46. { This is the structure used for the AT Interface core routines below }
  47.  
  48. CONST
  49.     kATATrap                    = $AAF1;                        {  Manager trap number <This should be defined in Traps.h> }
  50.     kATAPBVers1                    = $01;                            {  parameter block version number 1 }
  51.     kATAPBVers2                    = $02;                            {  parameter block version number for structures }
  52.     kATAPBVers3                    = $03;                            {  parameter block version for ATA times }
  53.     kATADefaultBlockSize        = 512;                            {  default block size }
  54.  
  55. {  Used to determine the presence of traps }
  56.     kFSMTrap                    = $AC;
  57.     mDQEChanged                    = 1;                            {  DQE has changed  }
  58.  
  59. {  Task file definition ••• Error Register ••• }
  60.     bATABadBlock                = 7;                            {  bit number of bad block error bit }
  61.     bATAUncorrectable            = 6;                            {  bit number of uncorrectable error bit }
  62.     bATAMediaChanged            = 5;                            {  bit number of media changed indicator }
  63.     bATAIDNotFound                = 4;                            {  bit number of ID not found error bit }
  64.     bATAMediaChangeReq            = 3;                            {  bit number of media changed request }
  65.     bATACommandAborted            = 2;                            {  bit number of command abort bit }
  66.     bATATrack0NotFound            = 1;                            {  bit number of track not found }
  67.     bATAAddressNotFound            = 0;                            {  bit number of address mark not found }
  68.     mATABadBlock                = $80;                            {  Bad Block Detected }
  69.     mATAUncorrectable            = $40;                            {  Uncorrectable Data Error }
  70.     mATAMediaChanged            = $20;                            {  Media Changed Indicator (for removable) }
  71.     mATAIDNotFound                = $10;                            {  ID Not Found }
  72.     mATAMediaChangeReq            = $08;                            {  Media Change Requested (NOT IMPLEMENTED) }
  73.     mATACommandAborted            = $04;                            {  Aborted Command }
  74.     mATATrack0NotFound            = $02;                            {  Track 0 Not Found }
  75.     mATAAddressNotFound            = $01;                            {  Address Mark Not Found }
  76.  
  77. {  Task file definition ••• Features register ••• }
  78.     bATAPIuseDMA                = 0;                            {  bit number of useDMA bit (ATAPI) }
  79.     mATAPIuseDMA                = $01;
  80.  
  81. {  Task file definition ••• ataTFSDH Register ••• }
  82.     mATAHeadNumber                = $0F;                            {  Head Number (bits 0-3)  }
  83.     mATASectorSize                = $A0;                            {  bit 7=1; bit 5 = 01 (512 sector size) <DP4> }
  84.     mATADriveSelect                = $10;                            {  Drive (0 = master, 1 = slave)  }
  85.     mATALBASelect                = $40;                            {  LBA mode bit (0 = chs, 1 = LBA) }
  86.  
  87. {  Task file definition ••• Status Register ••• }
  88.     bATABusy                    = 7;                            {  bit number of BSY bit }
  89.     bATADriveReady                = 6;                            {  bit number of drive ready bit }
  90.     bATAWriteFault                = 5;                            {  bit number of write fault bit }
  91.     bATASeekComplete            = 4;                            {  bit number of seek complete bit }
  92.     bATADataRequest                = 3;                            {  bit number of data request bit }
  93.     bATADataCorrected            = 2;                            {  bit number of data corrected bit }
  94.     bATAIndex                    = 1;                            {  bit number of index mark }
  95.     bATAError                    = 0;                            {  bit number of error bit }
  96.     mATABusy                    = $80;                            {  Unit is busy }
  97.     mATADriveReady                = $40;                            {  Unit is ready }
  98.     mATAWriteFault                = $20;                            {  Unit has a write fault condition }
  99.     mATASeekComplete            = $10;                            {  Unit seek complete }
  100.     mATADataRequest                = $08;                            {  Unit data request }
  101.     mATADataCorrected            = $04;                            {  Data corrected }
  102.     mATAIndex                    = $02;                            {  Index mark - NOT USED }
  103.     mATAError                    = $01;                            {  Error condition - see error register }
  104.  
  105. {  Task file definition ••• Device Control Register ••• }
  106.     bATADCROne                    = 3;                            {  bit number of always one bit }
  107.     bATADCRReset                = 2;                            {  bit number of reset bit }
  108.     bATADCRnIntEnable            = 1;                            {  bit number of interrupt disable }
  109.     mATADCROne                    = $08;                            {  always one bit }
  110.     mATADCRReset                = $04;                            {  Reset (1 = reset) }
  111.     mATADCRnIntEnable            = $02;                            {  Interrupt Disable(0 = enabled) }
  112.  
  113. {  ATA Command Opcode definition }
  114.     kATAcmdWORetry                = $01;                            {  Without I/O retry option }
  115.     kATAcmdNOP                    = $0000;                        {  NOP operation - media detect }
  116.     kATAcmdRecal                = $0010;                        {  Recalibrate command  }
  117.     kATAcmdRead                    = $0020;                        {  Read command  }
  118.     kATAcmdReadLong                = $0022;                        {  Read Long command }
  119.     kATAcmdWrite                = $0030;                        {  Write command  }
  120.     kATAcmdWriteLong            = $0032;                        {  Write Long }
  121.     kATAcmdWriteVerify            = $003C;                        {  Write verify }
  122.     kATAcmdReadVerify            = $0040;                        {  Read Verify command  }
  123.     kATAcmdFormatTrack            = $0050;                        {  Format Track command  }
  124.     kATAcmdSeek                    = $0070;                        {  Seek command  }
  125.     kATAcmdDiagnostic            = $0090;                        {  Drive Diagnostic command  }
  126.     kATAcmdInitDrive            = $0091;                        {  Init drive parameters command  }
  127.     kATAcmdReadMultiple            = $00C4;                        {  Read multiple }
  128.     kATAcmdWriteMultiple        = $00C5;                        {  Write multiple }
  129.     kATAcmdSetRWMultiple        = $00C6;                        {  Set Multiple for Read/Write Multiple }
  130.     kATAcmdReadDMA                = $00C8;                        {  Read DMA (with retries) }
  131.     kATAcmdWriteDMA                = $00CA;                        {  Write DMA (with retries) }
  132.     kATAcmdMCAcknowledge        = $00DB;                        {  Acknowledge media change - removable }
  133.     kATAcmdDoorLock                = $00DE;                        {  Door lock }
  134.     kATAcmdDoorUnlock            = $00DF;                        {  Door unlock }
  135.     kATAcmdStandbyImmed            = $00E0;                        {  Standby Immediate }
  136.     kATAcmdIdleImmed            = $00E1;                        {  Idle Immediate }
  137.     kATAcmdStandby                = $00E2;                        {  Standby }
  138.     kATAcmdIdle                    = $00E3;                        {  Idle }
  139.     kATAcmdReadBuffer            = $00E4;                        {  Read sector buffer command  }
  140.     kATAcmdCheckPowerMode        = $00E5;                        {  Check power mode command    <04/04/94> }
  141.     kATAcmdSleep                = $00E6;                        {  Sleep }
  142.     kATAcmdWriteBuffer            = $00E8;                        {  Write sector buffer command  }
  143.     kATAcmdWriteSame            = $00E9;                        {  Write same data to multiple sectors }
  144.     kATAcmdDriveIdentify        = $00EC;                        {  Identify Drive command  }
  145.     kATAcmdMediaEject            = $00ED;                        {  Media Eject }
  146.     kATAcmdSetFeatures            = $00EF;                        {  Set Features }
  147.  
  148. {  Set feature command opcodes }
  149.     kATAEnableWriteCache        = $02;                            {         Enable write cache }
  150.     kATASetTransferMode            = $03;                            {         Set transfer mode }
  151.     kATASetPIOMode                = $08;                            {         PIO Flow Control Tx Mode bit }
  152.     kATAEnableECC                = $88;                            {         ECC enable }
  153.     kATAEnableRetry                = $99;                            {         Retry enable }
  154.     kATAEnableReadAhead            = $AA;                            {         Read look-ahead enable }
  155.  
  156. {
  157.   --------------------------------------------------------------------------------
  158.    enums for dealing with device IDs
  159. }
  160.  
  161.     kATABusIDMask                = $000000FF;
  162.     kATADeviceIDMask            = $0000FF00;
  163.     kATADeviceIDClippingMask    = $0000FFFF;
  164.     kMinBusID                    = $00000000;
  165.     kMaxBusID                    = $000000FE;
  166.  
  167.     kATAStartIterateDeviceID    = $FFFF;
  168.     kATAEndIterateDeviceID        = $FF;
  169.  
  170. { -------------------------------------------------------------------------------- }
  171. { Device Register Images  (8 bytes) }
  172.  
  173. TYPE
  174.     ataTaskFilePtr = ^ataTaskFile;
  175.     ataTaskFile = RECORD
  176.         ataTFFeatures:            SInt8;                                    {  <-> Error(R) or ataTFFeatures(W) register image  }
  177.         ataTFCount:                SInt8;                                    {  <-> Sector count/remaining  }
  178.         ataTFSector:            SInt8;                                    {  <-> Sector start/finish  }
  179.         ataTFReserved:            SInt8;                                    {  reserved                     }
  180.         ataTFCylinder:            UInt16;                                    {  <-> ataTFCylinder (Big endian)  }
  181.         ataTFSDH:                SInt8;                                    {  <-> ataTFSDH register image }
  182.         ataTFCommand:            SInt8;                                    {  <-> Status(R) or Command(W) register image  }
  183.     END;
  184.  
  185. {  ATA Manager Function Code Definition }
  186.  
  187. CONST
  188.     kATAMgrNOP                    = $00;                            {  No Operation }
  189.     kATAMgrExecIO                = $01;                            {  Execute ATA I/O }
  190.     kATAMgrBusInquiry            = $03;                            {  Bus Inquiry }
  191.     kATAMgrQRelease                = $04;                            {  I/O Queue Release }
  192.     kATAMgrAbort                = $10;                            {  Abort command }
  193.     kATAMgrBusReset                = $11;                            {  Reset ATA bus }
  194.     kATAMgrRegAccess            = $12;                            {  Register Access }
  195.     kATAMgrDriveIdentify        = $13;                            {  Drive Identify            <DP03/10/94> }
  196.     kATAMgrDriverLoad            = $82;                            {  Load driver from either Media, ROM, etc. }
  197.     kATAMgrDriveRegister        = $85;                            {  Register a driver        <4/18/94> }
  198.     kATAMgrFindDriverRefnum        = $86;                            {  lookup a driver refnum    <4/18/94> }
  199.     kATAMgrRemoveDriverRefnum    = $87;                            {  De-register a driver    <4/18/94> }
  200.     kATAMgrModifyEventMask        = $88;                            {  Modify driver event mask }
  201.     kATAMgrDriveEject            = $89;                            {  Eject the drive        <8/1/94> }
  202.     kATAMgrGetDrvConfiguration    = $8A;                            {  Get device configuration    <8/6/94> }
  203.     kATAMgrSetDrvConfiguration    = $8B;                            {  Set device configuration <8/6/94> }
  204.     kATAMgrGetLocationIcon        = $8C;                            {  Get card location icon    <SM4> }
  205.     kATAMgrManagerInquiry        = $90;                            {  Manager Inquiry }
  206.     kATAMgrManagerInit            = $91;                            {  Manager initialization }
  207.     kATAMgrManagerShutdown        = $92;                            {  Manager ShutDown }
  208.                                                                 {  note: functions 0x93 to 0x97 are reserved }
  209.     kATAMgrFindSpecialDriverRefnum = $98;                        {  lookup a driver refnum; driverloader,notify-all or ROM driver. }
  210.     kATAMgrNextAvailable        = $99;
  211.  
  212. {  used in the ataDrvrFlags field for kATAMgrDriveRegister,kATAMgrRemoveDriverRefnum & kATAMgrFindSpecialDriverRefnum }
  213.     kATANotifyAllDriver            = 0;                            {  Notify-All driver }
  214.     kATADriverLoader            = 1;                            {  Driver loader driver         }
  215.     kATAROMDriver                = 2;                            {  ROM driver }
  216.  
  217. {  'ATAFlags' field of the PB header definition }
  218.     bATAFlagUseConfigSpeed        = 15;                            {  bit number of use default speed flag }
  219.     bATAFlagByteSwap            = 14;                            {  bit number of byte swap flag }
  220.     bATAFlagIORead                = 13;                            {  bit number of I/O read flag }
  221.     bATAFlagIOWrite                = 12;                            {  bit number of I/O write flag }
  222.     bATAFlagImmediate            = 11;                            {  bit number of immediate flag }
  223.     bATAFlagQLock                = 10;                            {  bit number of que lock on error }
  224.     bATAFlagReserved1            = 9;                            {  reserved }
  225.     bATAFlagUseScatterGather    = 8;                            {  bit numbers of scatter gather }
  226.     bATAFlagUseDMA                = 7;                            {  bit number of use DMA flag }
  227.     bATAFlagProtocolATAPI        = 5;                            {  bit number of ATAPI protocol }
  228.     bATAFlagReserved2            = 4;                            {  reserved }
  229.     bATAFlagTFRead                = 3;                            {  bit number of register update }
  230.     bATAFlagLEDEnable            = 0;                            {  bit number of LED enable }
  231.     mATAFlagUseConfigSpeed        = $8000;
  232.     mATAFlagByteSwap            = $4000;                        {  Swap data bytes (read - after; write - before) }
  233.     mATAFlagIORead                = $2000;                        {  Read (in) operation }
  234.     mATAFlagIOWrite                = $1000;                        {  Write (out) operation }
  235.     mATAFlagImmediate            = $0800;                        {  Head of Que; Immediate operation }
  236.     mATAFlagQLock                = $0400;                        {  Manager queue lock on error (freeze the queue) }
  237.     mATAFlagUseScatterGather    = $0100;                        {  Scatter gather enable }
  238.     mATAFlagUseDMA                = $80;
  239.     mATAFlagProtocolATAPI        = $20;                            {  ATAPI protocol indicator }
  240.     mATAFlagTFRead                = $08;                            {  update reg block request upon detection of an error }
  241.     mATAFlagLEDEnable            = $01;                            {  socket LED enable }
  242.  
  243. {  These are legacy ATAFlags definitions, which will go away in the future }
  244.     bATAFlagScatterGather1        = 9;                            {  9 }
  245.     bATAFlagScatterGather0        = 8;                            {  8 }
  246.     bATAFlagProtocol1            = 5;                            {  5 }
  247.     bATAFlagProtocol0            = 4;                            {  4 }
  248.     mATAFlagScatterGather1        = $0200;
  249.     mATAFlagScatterGather0        = $0100;
  250.     mATAFlagScatterGathers        = $0300;
  251.     mATAFlagProtocol1            = $20;
  252.     mATAFlagProtocol0            = $10;
  253.     mATAFlagProtocols            = $30;
  254.  
  255.  
  256. TYPE
  257.     ataPBHeaderPtr = ^ataPBHeader;
  258.     ataPBHeader = RECORD
  259.                                                                         {  Start of cloned common header ataPBHdr  }
  260.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  261.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  262.         ataPBVers:                SInt8;                                    {  -->: parameter block version number }
  263.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  264.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  265.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  266.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  267.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  268.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  269.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  270.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  271.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  272.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  273.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  274.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  275.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  276.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  277.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  278.                                                                         {  End of cloned common header ataPBHdr }
  279.     END;
  280.  
  281. {  data request entry structure (16 bytes) }
  282.     IOBlockPtr = ^IOBlock;
  283.     IOBlock = RECORD
  284.         ataPBBuffer:            Ptr;                                    {  -->: Data buffer pointer }
  285.         ataPBByteCount:            UInt32;                                    {  -->: Data transfer length in bytes }
  286.     END;
  287.  
  288. {
  289.    For ATAPI devices the ExtendedPB field is a pointer to the Command Packet
  290.    record which exists of an array of words structured as follows…    <06/15/94>
  291. }
  292.     ATAPICmdPacketPtr = ^ATAPICmdPacket;
  293.     ATAPICmdPacket = RECORD
  294.         atapiPacketSize:        SInt16;                                    {  Size of command packet in bytes    <06/15/94> }
  295.         atapiCommandByte:        ARRAY [0..7] OF SInt16;                    {  The command packet itself    <06/15/94> }
  296.     END;
  297.  
  298. {  Manager parameter block structure (96 bytes) }
  299.     ataIOPBPtr = ^ataIOPB;
  300.     ataIOPB = RECORD
  301.                                                                         {  Start of cloned common header ataPBHdr }
  302.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  303.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  304.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  305.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  306.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  307.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  308.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  309.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  310.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  311.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  312.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  313.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  314.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  315.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  316.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  317.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  318.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  319.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  320.                                                                         {  End of cloned common header ataPBHdr }
  321.         ataPBStatusRegister:    SInt8;                                    {  <--: Last ATA status image }
  322.         ataPBErrorRegister:        SInt8;                                    {  <--: Last ATA error image-valid if lsb of Status set }
  323.         ataPBReserved5:            SInt16;                                    {  Reserved }
  324.         ataPBLogicalBlockSize:    UInt32;                                    {  -->: Blind transfer size per interrupt (Logical block size) }
  325.         ataPBBuffer:            Ptr;                                    {  -->: Data buffer pointer }
  326.         ataPBByteCount:            UInt32;                                    {  -->: Data transfer length in bytes }
  327.         ataPBActualTxCount:        UInt32;                                    {  <--: Actual transfer count }
  328.         ataPBReserved6:            UInt32;                                    {  Reserved }
  329.         ataPBTaskFile:            ataTaskFile;                            {  <->:    Device register images }
  330.         ataPBPacketPtr:            ATAPICmdPacketPtr;                        {  -->: ATAPI packet command block pointer (valid with ATAPI bit set) }
  331.         ataPBReserved7:            ARRAY [0..5] OF SInt16;                    {  Reserved for future expansion }
  332.     END;
  333.  
  334. {  Parameter block structure for bus and Manager inquiry command }
  335. {  Manager parameter block structure }
  336.     ataBusInquiryPtr = ^ataBusInquiry;
  337.     ataBusInquiry = RECORD
  338.                                                                         {  Start of cloned common header ataPBHdr }
  339.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  340.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  341.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  342.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  343.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  344.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  345.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  346.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  347.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  348.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  349.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  350.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  351.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  352.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  353.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  354.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  355.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  356.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  357.                                                                         {  End of cloned common header ataPBHdr }
  358.         ataEngineCount:            UInt16;                                    {  <--: TBD; zero for now }
  359.         ataReserved1:            UInt16;                                    {  Reserved }
  360.         ataDataTypes:            UInt32;                                    {  <--: TBD; zero for now }
  361.         ataIOpbSize:            UInt16;                                    {  <--: Size of ATA IO PB }
  362.         ataMaxIOpbSize:            UInt16;                                    {  <--: TBD; zero for now }
  363.         ataFeatureFlags:        UInt32;                                    {  <--: TBD }
  364.         ataVersionNum:            SInt8;                                    {  <--: Version number for the HBA }
  365.         ataHBAInquiry:            SInt8;                                    {  <--: TBD; zero for now }
  366.         ataReserved2:            UInt16;                                    {  Reserved }
  367.         ataHBAPrivPtr:            UInt32;                                    {  <--: Ptr to HBA private data area }
  368.         ataHBAPrivSize:            UInt32;                                    {  <--: Size of HBA private data area }
  369.         ataAsyncFlags:            UInt32;                                    {  <--: Event capability for callback }
  370.         ataPIOModes:            SInt8;                                    {  <--: PIO modes supported (bit-significant) }
  371.         ataUltraDMAModes:        SInt8;                                    {  <--: Ultra DMA modes supported (b-sig) }
  372.         ataSingleDMAModes:        SInt8;                                    {  <--: Single Word DMA modes supported (b-sig)     }
  373.         ataMultiDMAModes:        SInt8;                                    {  <--: Multiword DMA modes supported (b-sig) }
  374.         ataReserved4:            ARRAY [0..3] OF UInt32;                    {  Reserved }
  375.         ataReserved5:            ARRAY [0..15] OF SInt8;                    {  TBD }
  376.         ataHBAVendor:            ARRAY [0..15] OF SInt8;                    {  <--: Vendor ID of the HBA }
  377.         ataContrlFamily:        ARRAY [0..15] OF SInt8;                    {  <--: Family of ATA Controller }
  378.         ataContrlType:            ARRAY [0..15] OF SInt8;                    {  <--: Model number of controller }
  379.         ataXPTversion:            ARRAY [0..3] OF SInt8;                    {  <--: version number of XPT }
  380.         ataReserved6:            ARRAY [0..3] OF SInt8;                    {  Reserved }
  381.         ataHBAversion:            NumVersion;                                {  <--: version number of HBA }
  382.         ataHBAslotType:            SInt8;                                    {  <--: type of slot }
  383.         ataHBAslotNum:            SInt8;                                    {  <--: slot number of the HBA }
  384.         ataReserved7:            UInt16;                                    {  Reserved }
  385.         ataReserved8:            UInt32;                                    {  Reserved }
  386.     END;
  387.  
  388. {  Manager parameter block structure }
  389.     ataMgrInquiryPtr = ^ataMgrInquiry;
  390.     ataMgrInquiry = RECORD
  391.                                                                         {  Start of cloned common header ataPBHdr }
  392.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  393.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  394.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  395.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  396.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  397.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  398.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  399.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  400.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  401.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  402.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  403.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  404.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  405.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  406.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  407.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  408.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  409.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  410.                                                                         {  End of cloned common header ataPBHdr }
  411.         ataMgrVersion:            NumVersion;                                {  Manager Version information }
  412.         ataMgrPBVers:            SInt8;                                    {  <--: Manager PB version number supported }
  413.         Reserved1:                SInt8;                                    {  Reserved }
  414.         ataBusCnt:                UInt16;                                    {  <--: Number of ATA buses in the system }
  415.         ataDevCnt:                UInt16;                                    {  <--: Total number of ATA devices detected }
  416.         ataPioModes:            SInt8;                                    {  <--: Maximum Programmed I/O speed mode supported }
  417.         Reserved2:                SInt8;                                    {  Reserved }
  418.         ataIOClkResolution:        UInt16;                                    {  <--: IO Clock resolution in nsec (Not supported) }
  419.         ataSingleDMAModes:        SInt8;                                    {  <--: Single Word DMA modes supported     }
  420.         ataMultiDMAModes:        SInt8;                                    {  <--: Multiword DMA modes supported }
  421.         Reserved:                ARRAY [0..15] OF SInt16;                {  Reserved for future expansion }
  422.     END;
  423.  
  424. {  Parameter block structure for Abort command }
  425. {  Manager parameter block structure }
  426.     ataAbortPtr = ^ataAbort;
  427.     ataAbort = RECORD
  428.                                                                         {  Start of cloned common header ataPBHdr }
  429.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  430.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  431.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  432.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  433.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  434.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  435.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  436.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  437.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  438.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  439.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  440.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  441.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  442.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  443.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  444.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  445.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  446.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  447.                                                                         {  End of cloned common header ataPBHdr }
  448.         ataAbortPB:                ataIOPBPtr;                                {  -->: Parameter block to be aborted }
  449.         Reserved:                ARRAY [0..21] OF SInt16;                {  Reserved for future expansion }
  450.     END;
  451.  
  452. {  Manager parameter block structure }
  453.     ATAEventRecPtr = ^ATAEventRec;
  454.     ATAEventRec = RECORD
  455.         ataEventCode:            UInt16;                                    {  --> ATA event code }
  456.         ataPhysicalID:            UInt16;                                    {  --> Physical drive reference }
  457.         ataDrvrContext:            SInt32;                                    {  Context pointer saved by driver }
  458.         ataMarker:                UInt32;                                    {  Always 'LOAD' }
  459.         ataEventRecVersion:        UInt32;                                    {  Version number of this data structure }
  460.         ataDeviceType:            UInt32;                                    {  Device type on bus (valid for load driver only) }
  461.         ataRefNum:                UInt16;                                    {  RefNum of driver (valid for remove driver only) }
  462.     END;
  463.  
  464. {$IFC TYPED_FUNCTION_POINTERS}
  465.     ATAClientProcPtr = FUNCTION(ataERPtr: ATAEventRecPtr): SInt16;
  466. {$ELSEC}
  467.     ATAClientProcPtr = ProcPtr;
  468. {$ENDC}
  469.  
  470.     ATAClientUPP = UniversalProcPtr;
  471.  
  472. CONST
  473.     uppATAClientProcInfo = $000000E0;
  474.  
  475. FUNCTION NewATAClientProc(userRoutine: ATAClientProcPtr): ATAClientUPP;
  476.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  477.     INLINE $2E9F;
  478.     {$ENDC}
  479.  
  480. FUNCTION CallATAClientProc(ataERPtr: ATAEventRecPtr; userRoutine: ATAClientUPP): SInt16;
  481.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  482.     INLINE $205F, $4E90;
  483.     {$ENDC}
  484. {  Parameter block structure for Driver Register command }
  485. {  Manager parameter block structure }
  486.  
  487. TYPE
  488.     ataDrvrRegisterPtr = ^ataDrvrRegister;
  489.     ataDrvrRegister = RECORD
  490.                                                                         {  Start of cloned common header ataPBHdr }
  491.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  492.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  493.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  494.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  495.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  496.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  497.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  498.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  499.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  500.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  501.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  502.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  503.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  504.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  505.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  506.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  507.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  508.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  509.                                                                         {  End of cloned common header ataPBHdr }
  510.         ataDrvrRefNum:            SInt16;                                    {  <->: Driver reference number }
  511.         ataDrvrFlags:            UInt16;                                    {  -->: 1 = loader driver if ataPBDeviceID = -1 (PB2) }
  512.         ataDeviceNextID:        UInt16;                                    {  <--: used to specified the next drive ID }
  513.         ataDrvrLoadPriv:        SInt16;                                    {  Driver loader private storage }
  514.         ataEventHandler:        ATAClientUPP;                            {  <->: Pointer to ATA event callback routine (PB2) }
  515.         ataDrvrContext:            SInt32;                                    {  <->: Context data saved by driver (PB2) }
  516.         ataEventMask:            SInt32;                                    {  <->: Set to 1 for notification of event (PB2) }
  517.         Reserved:                ARRAY [0..13] OF SInt16;                {  Reserved for future expansion - from [21] (PB2) }
  518.     END;
  519.  
  520. {  Parameter block structure for Modify driver event mask command }
  521.     ataModifyEventMaskPtr = ^ataModifyEventMask;
  522.     ataModifyEventMask = RECORD
  523.                                                                         {  Start of cloned common header ataPBHdr }
  524.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  525.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  526.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  527.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  528.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  529.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  530.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  531.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  532.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  533.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  534.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  535.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  536.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  537.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  538.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  539.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  540.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  541.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  542.                                                                         {  End of cloned common header ataPBHdr }
  543.         ataModifiedEventMask:    SInt32;                                    {  -->: new event mask value }
  544.         Reserved:                ARRAY [0..21] OF SInt16;                {  Reserved for future expansion }
  545.     END;
  546.  
  547. {  'ataRegMask' field of the ataRegAccess definition }
  548.  
  549. CONST
  550.     bATAAltSDevCValid            = 14;                            {  bit number of alternate status/device cntrl valid bit }
  551.     bATAStatusCmdValid            = 7;                            {  bit number of status/command valid bit }
  552.     bATASDHValid                = 6;                            {  bit number of ataTFSDH valid bit }
  553.     bATACylinderHiValid            = 5;                            {  bit number of cylinder high valid bit }
  554.     bATACylinderLoValid            = 4;                            {  bit number of cylinder low valid bit }
  555.     bATASectorNumValid            = 3;                            {  bit number of sector number valid bit }
  556.     bATASectorCntValid            = 2;                            {  bit number of sector count valid bit }
  557.     bATAErrFeaturesValid        = 1;                            {  bit number of error/features valid bit }
  558.     bATADataValid                = 0;                            {  bit number of data valid bit }
  559.     mATAAltSDevCValid            = $4000;                        {  alternate status/device control valid }
  560.     mATAStatusCmdValid            = $80;                            {  status/command valid }
  561.     mATASDHValid                = $40;                            {  ataTFSDH valid }
  562.     mATACylinderHiValid            = $20;                            {  cylinder high valid }
  563.     mATACylinderLoValid            = $10;                            {  cylinder low valid }
  564.     mATASectorNumValid            = $08;                            {  sector number valid }
  565.     mATASectorCntValid            = $04;                            {  sector count valid }
  566.     mATAErrFeaturesValid        = $02;                            {  error/features valid }
  567.     mATADataValid                = $01;                            {  data valid }
  568.  
  569. {  Parameter block structure for device register access command }
  570.  
  571. TYPE
  572.     ataRegValueUnionPtr = ^ataRegValueUnion;
  573.     ataRegValueUnion = RECORD
  574.         CASE INTEGER OF
  575.         0: (
  576.             ataByteRegValue:    SInt8;                                    {  <->: Byte register value read or to be written }
  577.             );
  578.         1: (
  579.             ataWordRegValue:    UInt16;                                    {  <->: Word register value read or to be written }
  580.             );
  581.     END;
  582.  
  583. {  Manager parameter block structure }
  584.     ataRegAccessPtr = ^ataRegAccess;
  585.     ataRegAccess = RECORD
  586.                                                                         {  Start of cloned common header ataPBHdr }
  587.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  588.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  589.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  590.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  591.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  592.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  593.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  594.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  595.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  596.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  597.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  598.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  599.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  600.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  601.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  602.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  603.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  604.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  605.                                                                         {  End of cloned common header ataPBHdr }
  606.         ataRegSelect:            UInt16;                                    {  -->: Device Register Selector }
  607.                                                                         {             DataReg            0     }
  608.                                                                         {             ErrorReg(R) or FeaturesReg(W)    1 }
  609.                                                                         {             SecCntReg        2 }
  610.                                                                         {             SecNumReg        3 }
  611.                                                                         {             CylLoReg        4 }
  612.                                                                         {             CylHiReg        5 }
  613.                                                                         {             SDHReg            6 }
  614.                                                                         {             StatusReg(R) or CmdReg(W)        7 }
  615.                                                                         {             AltStatus(R) or DevCntr(W)    0E }
  616.         ataRegValue:            ataRegValueUnion;
  617.                                                                         {  Following fields are valid only if ataRegSelect = 0xFFFF }
  618.         ataRegMask:                UInt16;                                    {  -->: mask for register(s) to update }
  619.                                                                         {         bit 0 : data register valid }
  620.                                                                         {         bit 1 : error/feaures register valid }
  621.                                                                         {         bit 2 : sector count register valid }
  622.                                                                         {         bit 3 : sector number register valid }
  623.                                                                         {         bit 4 : cylinder low register valid }
  624.                                                                         {         bit 5 : cylinder high register valid }
  625.                                                                         {         bit 6 : ataTFSDH register valid }
  626.                                                                         {         bit 7 : status/command register valid }
  627.                                                                         {         bits 8 - 13 : reserved (set to 0) }
  628.                                                                         {         bit 14: alternate status / device control reg valid }
  629.                                                                         {          bit 15: reserved (set to 0) }
  630.         ataRegisterImage:        ataTaskFile;                            {  <->: register images }
  631.         ataAltSDevCReg:            SInt8;                                    {  <->: Alternate status(R) or Device Control(W) register image }
  632.         Reserved3:                SInt8;                                    {  Reserved }
  633.         Reserved:                ARRAY [0..15] OF SInt16;                {  Reserved for future expansion }
  634.     END;
  635.  
  636. {  Manager parameter block structure    <DP03/10/94> }
  637.     ataIdentifyPtr = ^ataIdentify;
  638.     ataIdentify = RECORD
  639.                                                                         {  Start of cloned common header ataPBHdr }
  640.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  641.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  642.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  643.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  644.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  645.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  646.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  647.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  648.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  649.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  650.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  651.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  652.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  653.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  654.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  655.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  656.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  657.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  658.                                                                         {  End of cloned common header ataPBHdr }
  659.         Reserved1:                ARRAY [0..3] OF UInt16;                    {  Reserved.  These are used internally by the Manager }
  660.         ataPBBuffer:            Ptr;                                    {  Buffer for the identify data (512 bytes) }
  661.         Reserved2:                ARRAY [0..11] OF UInt16;                {  Used internally by the ATA Manager }
  662.         Reserved3:                ARRAY [0..5] OF SInt16;                    {  Reserved for future expansion }
  663.     END;
  664.  
  665. {  'ataConfigSetting' field of the Get/Set Device Configuration definition <8/6/94> }
  666.  
  667. CONST
  668.     ATAPIpacketDRQ_bit            = 6;                            {  bit number of ATAPI command packet DRQ option }
  669.     ATAPIpacketDRQ                = $40;                            {  ATAPI command packet DRQ option }
  670.  
  671. {  atapcValid field definition }
  672.     bATApcAccessMode            = 0;
  673.     bATApcVcc                    = 1;
  674.     bATApcVpp1                    = 2;
  675.     bATApcVpp2                    = 3;
  676.     bATApcStatus                = 4;
  677.     bATApcPin                    = 5;
  678.     bATApcCopy                    = 6;
  679.     bATApcConfigIndex            = 7;
  680.     bATApcLockUnlock            = 15;
  681.     mATApcAccessMode            = $01;
  682.     mATApcVcc                    = $02;
  683.     mATApcVpp1                    = $04;
  684.     mATApcVpp2                    = $08;
  685.     mATApcStatus                = $10;
  686.     mATApcPin                    = $20;
  687.     mATApcCopy                    = $40;
  688.     mATApcConfigIndex            = $80;
  689.     mATApcLockUnlock            = $8000;
  690.  
  691. {  Device physical type & socket type indicator definition }
  692.     kATADeviceUnknown            = $00;                            {  no device or type undetermined }
  693.     kATADeviceATA                = $01;                            {  traditional ATA protocol device <7/29/94> }
  694.     kATADeviceATAPI                = $02;                            {  ATAPI protocol device    <7/29/94> }
  695.     kATADeviceReserved            = $03;                            {  reserved by Apple (was PCMCIA) }
  696.  
  697.     kATASocketInternal            = $01;                            {  Internal ATA socket }
  698.     kATASocketMB                = $02;                            {  Media Bay socket }
  699.     kATASocketPCMCIA            = $03;                            {  PCMCIA socket }
  700.  
  701. {  reserved words at the end of the devConfig structure }
  702.     kATAConfigReserved            = 5;                            {  number of reserved words at the end }
  703.  
  704. {
  705.    Get/Set Device Configuration parameter block structure <8/6/94>
  706.    Manager parameter block structure
  707. }
  708.  
  709. TYPE
  710.     ataDevConfigurationPtr = ^ataDevConfiguration;
  711.     ataDevConfiguration = RECORD
  712.                                                                         {  Start of cloned common header ataPBHdr }
  713.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  714.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  715.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  716.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  717.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  718.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  719.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  720.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  721.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  722.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  723.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  724.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  725.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  726.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  727.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  728.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  729.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  730.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  731.                                                                         {  End of cloned common header ataPBHdr }
  732.         ataConfigSetting:        SInt32;                                    {  <->: Configuration setting }
  733.                                                                         {       Bits 3 - 0: Reserved }
  734.                                                                         {       Bit 4: Reserved (allowLBAAccess) }
  735.                                                                         {       Bit 5: Reserved (allowRWMultiple) }
  736.                                                                         {       Bit 6: ATAPIpacketDRQ }
  737.                                                                         {         1 = Check for Interrupt DRQ on ATAPI command packet DRQ }
  738.                                                                         {         0 = Default: Check only for the assertion of command packet DRQ }
  739.                                                                         {       Bits 31 - 7: Reserved }
  740.         ataPIOSpeedMode:        SInt8;                                    {  <->: Device access speed in PIO Mode }
  741.         Reserved3:                SInt8;                                    {  Reserved to force word alignment }
  742.         atapcValid:                UInt16;                                    {  <->: Set when pcXXX fields are valid (atapcAccessMode - atapcConfigIndex) }
  743.                                                                         {         bit 0 - atapcAccessMode field valid, when set }
  744.                                                                         {         bit 1 - atapcVcc field valid, when set }
  745.                                                                         {         bit 2 - atapcVpp1 field valid, when set }
  746.                                                                         {         bit 3 - atapcVpp2 field valid, when set }
  747.                                                                         {         bit 4 - atapcStatus field valid, when set }
  748.                                                                         {         bit 5 - atapcPin field valid, when set }
  749.                                                                         {         bit 6 - atapcCopy field valid, when set }
  750.                                                                         {         bit 7 - atapcConfigIndex field valid, when set }
  751.                                                                         {         bits 14-8 - Reserved }
  752.                                                                         {         bit 15 - device lock/unlock request (write only) }
  753.         ataRWMultipleCount:        UInt16;                                    {  Reserved for future (not supported yet) }
  754.         ataSectorsPerCylinder:    UInt16;                                    {  Reserved for future (not supported yet) }
  755.         ataHeads:                UInt16;                                    {  Reserved for future (not supported yet) }
  756.         ataSectorsPerTrack:        UInt16;                                    {  Reserved for future (not supported yet) }
  757.         ataSocketNumber:        UInt16;                                    {  <--: Socket number used by the CardServices }
  758.                                                                         {         0xFF = socket number invalid (Not a CardServices device) }
  759.                                                                         {         other = socket number of the device }
  760.         ataSocketType:            SInt8;                                    {  <--: Specifies the socket type (get config only) }
  761.                                                                         {         00 = Unknown socket }
  762.                                                                         {          01 = Internal ATA bus }
  763.                                                                         {         02 = Media Bay }
  764.                                                                         {         03 = PCMCIA }
  765.         ataDeviceType:            SInt8;                                    {  <--: Specifies the device type (get config only) }
  766.                                                                         {         00 = Unknown device }
  767.                                                                         {         01 = standard ATA device (HD) }
  768.                                                                         {         02 = ATAPI device }
  769.                                                                         {         03 = PCMCIA ATA device }
  770.         atapcAccessMode:        SInt8;                                    {  <->: Access mode: Memory vs. I/O (PCMCIA only) }
  771.         atapcVcc:                SInt8;                                    {  <->: Voltage in tenths of a volt (PCMCIA only) }
  772.         atapcVpp1:                SInt8;                                    {  <->: Voltage in tenths of a volt (PCMCIA only) }
  773.         atapcVpp2:                SInt8;                                    {  <->: Voltage in tenths of a volt (PCMCIA only) }
  774.         atapcStatus:            SInt8;                                    {  <->: Card Status register setting (PCMCIA only) }
  775.         atapcPin:                SInt8;                                    {  <->: Card Pin register setting (PCMCIA only) }
  776.         atapcCopy:                SInt8;                                    {  <->: Card Socket/Copy register setting (PCMCIA only) }
  777.         atapcConfigIndex:        SInt8;                                    {  <->: Card Option register setting (PCMCIA only) }
  778.         ataSingleDMASpeed:        SInt8;                                    {  <->: Single Word DMA Timing Class }
  779.         ataMultiDMASpeed:        SInt8;                                    {  <->: Multiple Word DMA Timing Class }
  780.         ataPIOCycleTime:        UInt16;                                    {  <->:Cycle time for PIO mode }
  781.         ataMultiCycleTime:        UInt16;                                    {  <->:Cycle time for Multiword DMA mode }
  782.         ataUltraDMASpeed:        SInt8;                                    {  <-> Ultra DMA timing class }
  783.         reserved2:                SInt8;                                    {  reserved }
  784.         ataUltraCycleTime:        UInt16;                                    {  <-> Cycle time for Ultra DMA mode }
  785.         Reserved1:                ARRAY [0..4] OF UInt16;                    {  Reserved for future }
  786.     END;
  787.  
  788. {  Get Card Location Icon/Text    <SM4> }
  789.  
  790. CONST
  791.     kATALargeIconHFS            = $0001;                        {  Large B&W icon with mask (HFS) }
  792.     kATALargeIconProDOS            = $0081;                        {  Large B&W icon with mask (ProDOS) }
  793.  
  794. {  Manager parameter block structure }
  795.  
  796. TYPE
  797.     ataLocationDataPtr = ^ataLocationData;
  798.     ataLocationData = RECORD
  799.                                                                         {  Start of cloned common header ataPBHdr }
  800.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  801.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  802.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  803.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  804.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  805.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  806.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  807.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  808.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  809.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  810.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  811.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  812.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  813.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  814.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  815.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  816.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  817.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  818.                                                                         {  End of cloned common header ataPBHdr }
  819.         ataIconType:            SInt16;                                    {  -->: icon type specifier }
  820.                                                                         {          1 = Large B&W icon with mask (256 bytes) }
  821.                                                                         {         0x81 = Same as 1, but ProDOS icon }
  822.         ataIconReserved:        SInt16;                                    {  Reserved to be longword aligned }
  823.         ataLocationIconPtr:        Ptr;                                    {  -->: Icon Data buffer pointer }
  824.         ataLocationStringPtr:    Ptr;                                    {  -->: Icon String buffer pointer }
  825.         Reserved1:                ARRAY [0..17] OF UInt16;                {  Reserved for future }
  826.     END;
  827.  
  828. {  ataOSType available }
  829.  
  830. CONST
  831.     kATAddTypeMacOS                = $0001;                        {  Blue Mac O/S ddType value }
  832.  
  833. {  The parameter block definition for all other ATA Manager functions. }
  834.  
  835.  
  836. TYPE
  837.     ataGenericPtr = ^ataGeneric;
  838.     ataGeneric = RECORD
  839.                                                                         {  Start of cloned common header ataPBHdr }
  840.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  841.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  842.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  843.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  844.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  845.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  846.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  847.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  848.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  849.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  850.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  851.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  852.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  853.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  854.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  855.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  856.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  857.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  858.                                                                         {  End of cloned common header ataPBHdr }
  859.         Reserved:                ARRAY [0..23] OF UInt16;                {  Reserved for future }
  860.     END;
  861.  
  862.     ataPBPtr = ^ataPB;
  863.     ataPB = RECORD
  864.         CASE INTEGER OF
  865.         0: (
  866.             ataIOParamBlock:    ataIOPB;                                {  parameter block for I/O }
  867.             );
  868.         1: (
  869.             ataBIParamBlock:    ataBusInquiry;                            {  parameter block for bus inquiry }
  870.             );
  871.         2: (
  872.             ataMIParamBlock:    ataMgrInquiry;                            {  parameter block for Manager inquiry }
  873.             );
  874.         3: (
  875.             ataAbortParamBlock:    ataAbort;                                {  parameter block for abort }
  876.             );
  877.         4: (
  878.             ataDRParamBlock:    ataDrvrRegister;                        {  parameter block for driver register }
  879.             );
  880.         5: (
  881.             ataMEParamBlock:    ataModifyEventMask;                        {  parameter block for event mask modify }
  882.             );
  883.         6: (
  884.             ataRAParamBlock:    ataRegAccess;                            {  parameter block for register access }
  885.             );
  886.         7: (
  887.             ataDIParamBlock:    ataIdentify;                            {  parameter block for drive identify }
  888.             );
  889.         8: (
  890.             ataDCParamBlock:    ataDevConfiguration;                    {  parameter block for device configuration }
  891.             );
  892.         9: (
  893.             ataLDParamBlock:    ataLocationData;                        {  parameter block for location icon data }
  894.             );
  895.                                                                         { ataManagerInit    ataInitParamBlock;        // parameter block for Manager initialization }
  896.                                                                         { ataManagerShutDn    ataSDParamBlock;        // parameter block for Manager shutdown }
  897.                                                                         { ataDrvrLoad        ataDLParamBlock;        // parameter block for Driver loading }
  898.         10: (
  899.             ataGenericParamBlock: ataGeneric;                            {  parameter block for all other functions }
  900.             );
  901.     END;
  902.  
  903. {  The ATA Event codes… }
  904.  
  905. CONST
  906.     kATANullEvent                = $00;                            {  Just kidding -- nothing happened }
  907.     kATAOnlineEvent                = $01;                            {  An ATA device has come online }
  908.     kATAOfflineEvent            = $02;                            {  An ATA device has gone offline }
  909.     kATARemovedEvent            = $03;                            {  An ATA device has been removed from the bus }
  910.     kATAResetEvent                = $04;                            {  Someone gave a hard reset to the drive }
  911.     kATAOfflineRequest            = $05;                            {  Someone requesting to offline the drive }
  912.     kATAEjectRequest            = $06;                            {  Someone requesting to eject the drive }
  913.     kATAUpdateEvent                = $07;                            {  Potential configuration change reported by CardServices <SM4> }
  914.     kATATaskTimeRequest            = $08;                            {  The manager is requesting to be called at Task Time }
  915.     kATALoadDriverNow            = $09;                            {  Load the driver for the given bus immediately }
  916.     kATAPIResetEvent            = $0A;                            {  Someone gave a ATAPI reset to the drive }
  917.                                                                 {  The following describes bit definitions in the eventMask field of ataDrvrRegister }
  918.     bATANullEvent                = $01;                            {  null event bit }
  919.     bATAOnlineEvent                = $02;                            {  online event bit }
  920.     bATAOfflineEvent            = $04;                            {  offline event bit }
  921.     bATARemovedEvent            = $08;                            {  removed event bit }
  922.     bATAResetEvent                = $10;                            {  ATA reset event bit }
  923.     bATAOfflineRequest            = $20;                            {  offline request event bit }
  924.     bATAEjectRequest            = $40;                            {  eject request event bit }
  925.     bATAUpdateEvent                = $80;                            {  configuration update event bit }
  926.     bATAPIResetEvent            = $0400;                        {  ATAPI reset event bit }
  927.  
  928.     kATAEventMarker                = 'LOAD';                        {  Marker for the event data structure }
  929.     kATAEventVersion1            = $00000001;                    {  Version 1 of the event structure }
  930.  
  931.  
  932. TYPE
  933. {$IFC TYPED_FUNCTION_POINTERS}
  934.     ATADispatchProcPtr = FUNCTION(VAR pb: ataPB): OSErr;
  935. {$ELSEC}
  936.     ATADispatchProcPtr = ProcPtr;
  937. {$ENDC}
  938.  
  939.     ATADispatchUPP = UniversalProcPtr;
  940.  
  941. CONST
  942.     uppATADispatchProcInfo = $000000E0;
  943.  
  944. FUNCTION NewATADispatchProc(userRoutine: ATADispatchProcPtr): ATADispatchUPP;
  945.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  946.     INLINE $2E9F;
  947.     {$ENDC}
  948.  
  949. FUNCTION CallATADispatchProc(VAR pb: ataPB; userRoutine: ATADispatchUPP): OSErr;
  950.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  951.     INLINE $205F, $4E90;
  952.     {$ENDC}
  953. FUNCTION ataManager(VAR pb: ataPB): SInt16;
  954.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  955.     INLINE $AAF1;
  956.     {$ENDC}
  957. { Device Error codes: 0xDB42 - 0xDB5F    }
  958.  
  959.  
  960. CONST
  961.     ATABaseErrCode                = -9406;                        {  Base error code - 0xDB42     }
  962.     ioPending                    = 1;                            {  Asynch I/O in progress status }
  963.     AT_NRdyErr                    = -9405;                        {  0xDB43: Drive not Ready  }
  964.     AT_IDNFErr                    = -9404;                        {  0xDB44: ID not found  }
  965.     AT_DMarkErr                    = -9403;                        {  0xDB45: Data mark not found  }
  966.     AT_BadBlkErr                = -9402;                        {  0xDB46: Bad Block  }
  967.     AT_CorDataErr                = -9401;                        {  0xDB47: Data was corrected  }
  968.     AT_UncDataErr                = -9400;                        {  0xDB48: Data was not corrected  }
  969.     AT_SeekErr                    = -9399;                        {  0xDB49: Seek error  }
  970.     AT_WrFltErr                    = -9398;                        {  0xDB4A: Write fault  }
  971.     AT_RecalErr                    = -9397;                        {  0xDB4B: Recalibrate failed  }
  972.     AT_AbortErr                    = -9396;                        {  0xDB4C: Command aborted by drive  }
  973.     AT_MCErr                    = -9394;                        {  0xDB4E: Media Changed error }
  974.     ATAPICheckErr                = -9393;                        {  0xDB4F: ATAPI Check condition <06/15/94> }
  975.                                                                 {  System error codes...Custom Driver Error Codes 0xDB60 - 0xDB6F }
  976.     DRVRCantAllocate            = -9376;                        {  0xDB60: Allocation error during initialization }
  977.     NoATAMgr                    = -9375;                        {  0xDB61: MgrInquiry failed => No ATA Manager }
  978.     ATAInitFail                    = -9374;                        {  0xDB62: Mgr Initialization failed }
  979.     ATABufFail                    = -9373;                        {  0xDB63: Device buffer test failure }
  980.     ATADevUnsupported            = -9372;                        {  0xDB64: Device type not supported }
  981.     ATAEjectDrvErr                = -9371;                        {  0xDB65: Could not eject the drive }
  982.                                                                 {  Manager Error Codes 0xDB70 - 0xDB8F }
  983.     ATAMgrNotInitialized        = -9360;                        {  0xDB70: Mgr has not been initialized }
  984.     ATAPBInvalid                = -9359;                        {  0xDB71: The bus base address couldn't be found }
  985.     ATAFuncNotSupported            = -9358;                        {  0xDB72: An unknown function code specified }
  986.     ATABusy                        = -9357;                        {  0xDB73: Selected device is busy }
  987.     ATATransTimeOut                = -9356;                        {  0xDB74: Transaction timeout detected }
  988.     ATAReqInProg                = -9355;                        {  0xDB75: Channel busy; channel is processing another cmd }
  989.     ATAUnknownState                = -9354;                        {  0xDB76: Device status register reflects an unknown state }
  990.     ATAQLocked                    = -9353;                        {  0xDB77: I/O Queue is locked due to previous I/O error. }
  991.     ATAReqAborted                = -9352;                        {  0xDB78: The I/O queue entry was aborted due to an abort req. }
  992.                                                                 {             or due to Manager shutdown. }
  993.     ATAUnableToAbort            = -9351;                        {  0xDB79: The I/O queue entry could not be aborted. }
  994.     ATAAbortedDueToRst            = -9350;                        {  0xDB7A: Request aborted due to a device reset command. }
  995.     ATAPIPhaseErr                = -9349;                        {  0xDB7B: Unexpected phase - •••IS THIS VALID ERROR??? <06/15/94> }
  996.     ATAPITxCntErr                = -9348;                        {  0xDB7C: Overrun/Underrun condition detected }
  997.     ATANoClientErr                = -9347;                        {  0xDB7D: No client present to handle the event }
  998.     ATAInternalErr                = -9346;                        {  0xDB7E: MagnumOpus returned an error }
  999.     ATABusErr                    = -9345;                        {  0xDB7F: Bus error detected on I/O     }
  1000.     AT_NoAddrErr                = -9344;                        {  0xDB80: Invalid AT base adress  }
  1001.     DriverLocked                = -9343;                        {  0xDB81: Current driver must be removed before adding another }
  1002.     CantHandleEvent                = -9342;                        {  0xDB82: Particular event couldn't be handled (call others) }
  1003.     ATAMgrMemoryErr                = -9341;                        {  0xDB83: Manager memory allocation error     }
  1004.     ATASDFailErr                = -9340;                        {  0xDB84: Shutdown failure                 }
  1005.     ATAXferParamErr                = -9339;                        {  0xDB85: I/O xfer parameters inconsistent  }
  1006.     ATAXferModeErr                = -9338;                        {  0xDB86: I/O xfer mode not supported  }
  1007.     ATAMgrConsistencyErr        = -9337;                        {  0XDB87: Manager detected internal inconsistency.  }
  1008.     ATADmaXferErr                = -9336;                        {  0XDB88: fatal error in DMA side of transfer  }
  1009.                                                                 {  Driver loader error Codes 0xDB90 - 0xDBA5 }
  1010.     ATAInvalidDrvNum            = -9328;                        {  0xDB90: Invalid drive number from event }
  1011.     ATAMemoryErr                = -9327;                        {  0xDB91: Memory allocation error }
  1012.     ATANoDDMErr                    = -9326;                        {  0xDB92: No DDM found on media     }
  1013.     ATANoDriverErr                = -9325;                        {  0xDB93: No driver found on the media     }
  1014.  
  1015. { ------------------------    Version 1 definition -------------------------------    }
  1016.     v1ATABaseErrCode            = $0700;                        {  This needs a home somewhere }
  1017.     v1AT_NRdyErr                = $FFFFF901;                    {  0xF901: -0x1DBE  }
  1018.     v1AT_IDNFErr                = $FFFFF904;                    {  0xF904: -0x1DC0  }
  1019.     v1AT_DMarkErr                = $FFFFF905;                    {  0xF905: -0x1DC0  }
  1020.     v1AT_BadBlkErr                = $FFFFF906;                    {  0xF906: -0x1DC0  }
  1021.     v1AT_CorDataErr                = $FFFFF907;                    {  0xF907: -0x1DC0  }
  1022.     v1AT_UncDataErr                = $FFFFF908;                    {  0xF908: -0x1DC0  }
  1023.     v1AT_SeekErr                = $FFFFF909;                    {  0xF909: -0x1DC0  }
  1024.     v1AT_WrFltErr                = $FFFFF90A;                    {  0xF90A: -0x1DC0  }
  1025.     v1AT_RecalErr                = $FFFFF90B;                    {  0xF90B: -0x1DC0  }
  1026.     v1AT_AbortErr                = $FFFFF90C;                    {  0xF90C: -0x1DC0  }
  1027.     v1AT_NoAddrErr                = $FFFFF90D;                    {  0xF90D: -0x1D8D  }
  1028.     v1AT_MCErr                    = $FFFFF90E;                    {  0xF90E: -0x1DC0 }
  1029.                                                                 {  System error codes...Custom Driver Error Codes }
  1030.     v1DRVRCantAllocate            = -1793;                        {  0xF8FF: -0x1D9F }
  1031.     v1NoATAMgr                    = -1794;                        {  0xF8FE: -0x1D9D }
  1032.     v1ATAInitFail                = -1795;                        {  0xF8FD: -0x1D9B }
  1033.     v1ATABufFail                = -1796;                        {  0xF8FC: -0x1D99 }
  1034.     v1ATADevUnsupported            = -1797;                        {  0xF8FB: -0x1c97 }
  1035.                                                                 {  Manager Error Codes }
  1036.     v1ATAMgrNotInitialized        = -1802;                        {  0xF8F6: -0x1D86 }
  1037.     v1ATAPBInvalid                = -1803;                        {  0xF8F5: -0x1D84 }
  1038.     v1ATAFuncNotSupported        = -1804;                        {  0xF8F4: -0x1D82 }
  1039.     v1ATABusy                    = -1805;                        {  0xF8F3: -0x1D80 }
  1040.     v1ATATransTimeOut            = -1806;                        {  0xF8F2: -0x1D7E }
  1041.     v1ATAReqInProg                = -1807;                        {  0xF8F1: -0x1D7C }
  1042.     v1ATAUnknownState            = -1808;                        {  0xF8F0: -0x1D7A }
  1043.     v1ATAQLocked                = -1809;                        {  0xF8EF: -0x1D78 }
  1044.     v1ATAReqAborted                = -1810;                        {  0xF8EE: -0x1D76 }
  1045.     v1ATAUnableToAbort            = -1811;                        {  0xF8ED: -0x1D74 }
  1046.     v1ATAAbortedDueToRst        = -1812;                        {  0xF8EC: -0x1D72 }
  1047.  
  1048.  
  1049. {$ALIGN RESET}
  1050. {$POP}
  1051.  
  1052. {$SETC UsingIncludes := ATAIncludes}
  1053.  
  1054. {$ENDC} {__ATA__}
  1055.  
  1056. {$IFC NOT UsingIncludes}
  1057.  END.
  1058. {$ENDC}
  1059.